using System;
using Castle.ActiveRecord;
using CosyTrade.Data;
using CosyTrade.Organization;

namespace CosyTrade.Distribution
{
    [AddPropertyChangedNotifyInterface, PropertyChangedNotify]
    [ActiveRecord("tabClientCategoryBase"), Serializable, JoinedBase]
    public class ClientCategoryBase : BusinessObject
    {
        private readonly Guid primaryKey = Guid.NewGuid();
        private string captionChinese;
        private string captionSpaish;
        private bool isParentCategory;
        private Company onCompany;

        [PrimaryKey(PrimaryKeyType.Assigned, "ROWGUID", Access = PropertyAccess.NosetterCamelcase)]
        public override Guid PrimaryKey
        {
            get { return primaryKey; }
        }

        [Property]
        public string CaptionChinese
        {
            get { return captionChinese; }
            set { captionChinese = value; }
        }

        [Property]
        public string CaptionSpaish
        {
            get { return captionSpaish; }
            set { captionSpaish = value; }
        }

        [Property]
        public bool IsParentCategory
        {
            get { return isParentCategory; }
            set { isParentCategory = value; }
        }

        [BelongsTo("CompanyGuid")]
        public Company OnCompany
        {
            get { return onCompany; }
            set { onCompany = value; }
        }
    }
}